<div class="custom">

    <h1>
        今日订单
    </h1>


    <form class="row form-inline" >
        <div class="row" style="margin-left:0px">
            <div class="form-group col-md-3" >
                <label class="" >订单号</label>
                <input class=" form-control"  type="input" ng-model="queryData.orderNo" placeholder="订单号" value="queryData.orderId">
            </div>
            <div class="form-group col-md-3">
                <label class="">截止日期</label>
                <input class=" form-control" type="date" ng-model="queryData.ctime_like" placeholder="截止日期" value="queryData.ctime_like | date:'yyyy-MM-dd'">
            </div>
        </div>

    </form>
    <div class="row" style="margin-left:0px">
        <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
            <button type="button" class="btn btn-warning btn-block" ng-click="orderNumer()" >订单一键编号</button>
        </div>
        <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
            <button type="button" class="btn btn-warning btn-block" ng-click="doQuery(queryData.orderNo,queryData.ctime_tend);" >查询</button>
        </div>

        <div class="form-group col-md-2" style="margin-top:10px;margin-bottom:10px;">
            <button type="reset"  class="btn btn-default" ng-click="reset()">重置</button>
        </div>
    </div>




    <div style="margin:10px 0"><span>订单总数：{{totalSize}}</span> <a type="button" class="btn btn-success btn-sm"  ng-click="export()">导出</a><span style="float:right">截止时间：{{date}}</span></div>
    <div ng-if="data.isShowDetail">

        <div class="panel panel-default" >

            <div class="panel-heading clearfix">
                订单号：{{data.orderNo}}
                <div class="btn-group pull-right" role="group" aria-label="...">
                    <button type="button" class="btn btn-warning btn-sm" ng-click="saveOrderDetailInfo();">全部保存</button>
                    <button type="button" class="btn btn-default btn-sm" ng-click="data.isShowDetail=false;">收起</button>
                </div>
            </div>

            <table class="table table-bordered panel-body table-hover table-condensed ">

                <thead>
                <tr>
                    <th width="10%">#</th>
                    <th width="20%">商品id</th>
                    <th width="20%">商品名称</th>
                    <th width="20%" hidden>单位</th>
                    <th width="10%">实际购买数量</th>
                    <th width="10%">单价</th>
                    <th width="10%">总价</th>
                </tr>
                </thead>

                <tbody>
                <tr ng-repeat="item in orderDetailList">
                    <th>{{$index+1}}</th>
                    <td>{{item.commodityId}}</td>
                    <td>{{item.commodityName}}</td>
                    <th hidden>{{item.unit}}</th>
                    <!--<td><input type="number" ng-model="item.actualNumber"  ng-show="queryData.orderStatus==0"><span  ng-show="queryData.orderStatus!=0">{{item.actualNumber}}</span></td>-->
                    <!--<td><input type="number" ng-model="item.number" ng-show="queryData.orderStatus!=2"><span ng-show="queryData.orderStatus==2"></span></td>-->
                    <td>{{item.number}}</td>
                    <td>{{item.unitPrice}}</td>
                    <td>{{item.totalPrice}}</td>
                </tr>

                </tbody>

            </table>

        </div>

    </div>



    <div class="panel panel-default">

        <table class="table table-bordered table-condensed" >
            <thead>
            <tr>
                <th >#</th>
                <th >订单号</th>
                <th >客户店名</th>
                <th >区域编号</th>
                <th >负责人</th>
                <th>联系电话</th>
                <th >送货时间</th>
                <th >订单金额</th>
                <th >详细地址</th>
                <th >客户需求</th>
                <th >支付方式</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="item in data.resultData">
                <th>{{$index+1}}</th>
                <th>
                    {{item.orderNo}}
                </th>
                <th>
                    {{item.storeName}}
                </th>
                <th>
                    {{item.areaCode}}
                </th>
                <th>
                    {{item.shippingPerson}}
                </th>
                <th>
                    {{item.shippingPhone}}
                </th>
                <th>
                    {{item.receivingDate}}
                </th>
                <th>
                    {{item.totalPrice}}
                </th>
                <th>
                    {{item.shippingAddress}}
                </th>
                <th>
                    {{item.remarks}}
                </th>
                <th>
                    {{item.payType | payType}}
                </th>
                <td>
                    <a ng-click="queryOrderDetail(item.orderId);" href="">详细</a>
                    <a ui-sref="admin.addLinePreOrder({id:item.orderId})">修改</a>
                    <a ng-click="del(item.orderId)">删除</a>
                    <!--<a ng-click="paySuccess(item.orderId);" class="btn btn-xs btn-success" ng-hide="item.orderStatus == 1">支付完成</a>-->
                </td>
            </tr>
            </tbody>
        </table>

        <div class="panel-footer" style="text-align: center;">
            <uib-pagination style="margin:0;" ng-change="pageChanged(data.currentPage)" total-items="data.totalSize" ng-model="data.currentPage"
                            items-per-page="data.pageSize" max-size="5" class="pagination-sm" boundary-links="true"
                            rotate="false"></uib-pagination>
        </div>

    </div>

    <div ng-if="!data" style="text-align: center">
        加载中...
    </div>

</div>